package com.dfbz.demo02_Class;

/**
 * @author lscl
 * @version 1.0
 * @intro:
 */
public class Cate {
    private String name;            // 美食名称
    private String taste;          // 口味偏重
    private Boolean recommend;      // 是否推荐

    // 有参构造
    public Cate(String name, String taste, Boolean recommend) {
        System.out.println("公共方法");
        this.name = name;
        this.taste = taste;
        this.recommend = recommend;
    }


    // 受保护的构造
    protected Cate(String name, String taste) {
        System.out.println("受保护方法");
        this.name = name;
        this.taste = taste;
    }


    // 默认构造
    Cate(String name) {
        System.out.println("默认方法");
        this.name = name;
    }


    // 私有构造
    private Cate(String name, Boolean recommend) {
        System.out.println("私有方法");
        this.name = name;
        this.recommend = recommend;
    }

    // 空参构造
    public Cate() {
        System.out.println("公共方法");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getTaste() {
        return taste;
    }

    public void setTaste(String taste) {
        this.taste = taste;
    }

    public Boolean getRecommend() {
        return recommend;
    }

    public void setRecommend(Boolean recommend) {
        this.recommend = recommend;
    }

    @Override
    public String toString() {
        return "Cate{" +
                "name='" + name + '\'' +
                ", taste='" + taste + '\'' +
                ", recommend=" + recommend +
                '}';
    }
}
